<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/1/20/020
 * Time: 13:05
 */

namespace app\api\service;


use app\lib\exception\ShopException;

class Shop {

    /**
     * 检查店铺有效性
     * @param $shop
     * @return bool
     * @throws ShopException
     */
    public static function checkShop($shop) {
        if (!$shop) {
            throw new ShopException();
        }

        if ($shop['status'] != 2) {
            throw new ShopException([
                'msg' => '店铺正在审核中',
                'errorCode' => 16002
            ]);
        }

        return true;
    }
}